package com.sunchangpeng.gemini.task;

import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

@Slf4j
public class TaskAgent implements Job {
    private TaskDetail taskDetail;

    public void setTaskDetail(TaskDetail taskDetail) {
        this.taskDetail = taskDetail;
    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("task execute begin.ScheduledFireTime: {}  FireTime: {} RefireCount: {}", context.getScheduledFireTime(), context.getFireTime(), context.getRefireCount());

        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        log.info("task execute  end.");
    }
}
